<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!--如果想在工具栏加入更多按钮，可以使用插槽方式， slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
          <el-form-item label="训练前地面(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xlqDm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="吸氧排氮(5500m)(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl5500Xypd" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="5500m即刻(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl5500" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="5500m 20min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl550060" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="5500m 120min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl5500120" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="5500m 180min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl5500180" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="5500m 240min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl5500240" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="5500m 300min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl5500300" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 即刻(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 20min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl700020" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 40min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl700040" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 60min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl700060" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 80min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl700080" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 100min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000100" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 120min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000120" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 140min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000140" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 160min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000160" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 180min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000180" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 200min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000200" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 220min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000220" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 240min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000240" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 260min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000260" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 280min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000280" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 300min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000300" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 320min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000320" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 340min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000340" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="7000m 360min(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xl7000360" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="训练后地面(血氧饱和|心率|呼吸|血压)">
            <el-input v-model="form.xlhDm" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="主观症状(症状id1|症状id2|...|其他)">
            <el-input v-model="form.zhzz" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="书写表现">
            <el-input v-model="form.sxbx" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="结果判定(0:优秀,1:良好,2:合格,3:不合格)">
            <el-input v-model="form.result" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="建议">
            <el-input v-model="form.jy" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="记录日期">
            <el-input v-model="form.date" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="记录人">
            <el-input v-model="form.createBy" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="sxbx" label="书写表现" />
        <el-table-column prop="result" label="结果判定(0:优秀,1:良好,2:合格,3:不合格)" />
        <el-table-column prop="date" label="记录日期" />
        <el-table-column prop="createBy" label="记录人" />
        <el-table-column v-if="checkPer(['admin','trainDycgksl:edit','trainDycgksl:del'])" label="操作" width="150px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudTrainDycgksl from '@/api/trainDycgksl'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'

const defaultForm = { id: null, trainId: null, xlqDm: null, xl5500Xypd: null, xl5500: null, xl550060: null, xl5500120: null, xl5500180: null, xl5500240: null, xl5500300: null, xl7000: null, xl700020: null, xl700040: null, xl700060: null, xl700080: null, xl7000100: null, xl7000120: null, xl7000140: null, xl7000160: null, xl7000180: null, xl7000200: null, xl7000220: null, xl7000240: null, xl7000260: null, xl7000280: null, xl7000300: null, xl7000320: null, xl7000340: null, xl7000360: null, xlhDm: null, zhzz: null, sxbx: null, result: null, jy: null, date: null, createBy: null, trainItemId: null }
export default {
  name: 'TrainDycgksl',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '低压舱高空胜利综合训练', url: 'api/trainDycgksl', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTrainDycgksl }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'trainDycgksl:add'],
        edit: ['admin', 'trainDycgksl:edit'],
        del: ['admin', 'trainDycgksl:del']
      },
      rules: {
      }    }
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>

<style scoped>

</style>
